var color0 = Color.magenta;
var color1 = Color.red;
var duration = 1.0;
 
function Start () {
    while (true) {
        yield LerpLightColor (color0, Color.black);
        yield LerpLightColor (Color.black, color1); 
        yield LerpLightColor (color1, Color.black);
        yield LerpLightColor (Color.black, color0); 
    }
}
 
function LerpLightColor (col1 : Color, col2 : Color) {
    var t = 0.0;
    var rate = 1.0/duration;
    while (t < 1.0) {
        t += Time.deltaTime * rate;
        light.color = Color.Lerp(col1, col2, t);
        yield;
    }
}